package com.yutel.comp.queue;

public class QueueConfig {

	private static Consumer qConsumer;
	private static Producer qProducer;

	public static Consumer getConsumer() {
		return qConsumer;
	}

	public static Producer getProducer() {
		return qProducer;
	}

	public static void initConsumer(String serverHost, String QueueName,
			int QueueInterval) {
		qConsumer = new Consumer(serverHost, QueueName, QueueInterval);
	}

	public static void initProducer(String serverHost, String QueueName,
			int QueueInterval) {
		qProducer = new Producer(serverHost, QueueName, QueueInterval, "test",
				1000);
	}

	public static void initProducer(String serverHost, String QueueName,
			int QueueInterval, String HeartbeatName, int HeartbeatRate) {
		qProducer = new Producer(serverHost, QueueName, QueueInterval,
				HeartbeatName, HeartbeatRate);
	}

	public static class Consumer {
		public String ServiceUrl;
		public String QueueName;
		public int QueueInterval;

		public Consumer(String ServiceUrl, String QueueName, int QueueInterval) {
			this.ServiceUrl = ServiceUrl;
			this.QueueName = QueueName;
			this.QueueInterval = QueueInterval;
		}

	}

	public static class Producer {
		public String ServiceUrl;
		public String QueueName;
		public int QueueInterval;
		public String HeartbeatName;
		public int HeartbeatRate;

		public Producer(String ServiceUrl, String QueueName, int QueueInterval,
				String HeartbeatName, int HeartbeatRate) {
			this.ServiceUrl = ServiceUrl;
			this.QueueName = QueueName;
			this.QueueInterval = QueueInterval;
			this.HeartbeatName = HeartbeatName;
			this.HeartbeatRate = HeartbeatRate;
		}
	}

}
